import requests
from lxml import etree

url = 'https://cps.kwaixiaodian.com/zone-cps/promoter_square/good_promoter_page?detailSource=CPS_BIZ_MERCHANT_RECOMMEND_CARD'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
}
response = requests.get(url, headers=headers)

if response.status_code == 200:
    response.encoding = 'utf-8'
    # ret = response.text
    # print(response.text)
else:
    print('请求失败')

tree = etree.HTML(response.text)  # 将源码转化为能被XPath匹配的格式

items = tree.xpath("//*[@id='rc-tabs-0-panel-1']/div/div/div/div[position()>1]")
print(items)
#  //*[@id="rc-tabs-0-panel-1"]/div/div/div/div[position()>1]
# selector.xpath(表达式)  # 返回为一列表
